home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
biblio
/
bibtex
/
utils
/
refer-tools
/
ref2bib.shar
/
ref2bib.sed
< prev
next >
Wrap
Text File
|
1992-07-01
|
4KB
|
201 lines
#
# sed script to do some of the ref to bib database conversion
#
# written by Peter King, Heriot-Watt University
# You may do anything you like with this code
# EXCEPT claim that you wrote it
#
# First alter the TeX special characters
s/\(.\)%/\1\\%/g
s/&/\\&/g
s/\$/\\$/g
s/#/\\#/g
s/_/\\_/g
s/{/\\{/g
s/}/\\}/g
# convert the special characters and accents from troff to BibTeX
# assumes the accents are those of the Berkeley -ms with .AM
#
/\\/s/\(.\)\\\\*\*'/{\\'\1}/g
/\\/s/\(.\)\\\\*\*`/{\\`\1}/g
/\\/s/\(.\)\\\\*\*^/{\\^\1}/g
/\\/s/\(.\)\\\\*\*:/{\\"\1}/g
/\\/s/\(.\)\\\\*\*~/{\\~\1}/g
/\\/s/\(.\)\\\\*\*_/{\\=\1}/g
/\\/s/\([oO]\)\\\\*\*\//{\\\1}/g
/\\/s/\([aA]\)\\\\*\*o/{\\\1\1}/g
/\\/s/\(.\)\\\\*\*,/{\\c{\1}}/g
/\\/s/\(.\)\\\\*\*v/{\\v{\1}}/g
/\\/s/\(.\)\\\\*\*"/{\\H{\1}}/g
/\\/s/\(.\)\\\\*\*\./{\\d{\1}}/g
/\\/s/\\\\*\*8/{\\ss}/g
/\\/s/\\\\*\*(P\([lL]\)/{\\\1}/g
/\\/s/\\\\*\*(\([oO]\)\//{\\\1}/g
# quotes
/\\/s/\\\\*\*Q/``/g
/\\/s/\\\\*\*U/''/g
/\\/s/\\\\*\*-/---/g
# \0 as space between surname de\0Souza etc.
/\\/s/\\\\*0\([a-z]*\)\\\\*0/\\0\1 /g
/\\/s/ \([a-z]*\)\\\\*0/ \1 /g
# but trap the ones that start with a capital letter and convert them to
# ties
/\\/s/\\\\*0/~/g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/g
/\\/s/\\\\*(\*R/P/g
/\\/s/\\\\*(\*S/$\\Sigma$/g
/\\/s/\\\\*(\*T/T/g
/\\/s/\\\\*(\*U/$\\Upsilon$/g
/\\/s/\\\\*(\*F/$\\Phi$/g
/\\/s/\\\\*(\*X/X/g
/\\/s/\\\\*(\*Q/$\\Psi$/g
/\\/s/\\\\*(\*W/$\\Omega$/g
# Now trap title words that must be capitalised
/^%[^T]/b
#
# first all words that are all capitals (at least two consecutive)
# we need the slashes to allow for M/M/1 queues
s;[A-Z][A-Z/][A-Z/0-9]*;{&};g
#
# then some proper names
# first some mathematicians
# (for some I've added the Pattern [^ -]* toe the end to get Markov,
# Markovian, etc.
s/Abel/{&}/g
s/Bernoulli/{&}/g
s/Bessel/{&}/g
s/Beta/{&}/g
s/Borel/{&}/g
s/Cauchy/{&}/g
s/Church/{&}/g
s/Rosser/{&}/g
s/Dedekind/{&}/g
s/Descartes/{&}/g
s/Dirichlet/{&}/g
s/Euclid[^ -,;]*/{&}/g
s/Euler/{&}/g
s/Fibonacci/{&}/g
s/Fermat/{&}/g
s/Fourier/{&}/g
s/Fresnel/{&}/g
s/Frobenius/{&}/g
s/Perron/{&}/g
s/Gamma/{&}/g
s/Gauss[^ -,;]*/{&}/g
s/Hilbert/{&}/g
s/Horner/{&}/g
s/Holder/{&}/g
s/Jacobi[^ -,;]*/{&}/g
s/Jensen/{&}/g
s/Markov[^ -,;]*/{&}/g
s/Arnoldi/{&}/g
s/Laplace/{&}/g
s/Laguerre/{&}/g
s/Lagrange/{&}/g
s/Legendre/{&}/g
s/Leibnitz/{&}/g
s/Rayleigh/{&}/g
s/Ritz/{&}/g
s/Riemann/{&}/g
# this is really Rouche (acute accent) , but the accent processing will disrupt it
s/Rouch/{&}/g
s/Stieltjes/{&}/g
s/Stiener/{&}/g
s/Schwarz/{&}/g
s/Weibull/{&}/g
s/Wald/{&}/g
s/Kronecker/{&}/g
s/Diophantine/{&}/g
s/Delbrouck/{&}/g
s/Bayes[^ -,;]*/{&}/g
s/Jackson/{&}/g
s/Newhall/{&}/g
s/Turing/{&}/g
s/Norton/{&}/g
s/Petri/{&}/g
s/Wilkinson/{&}/g
s/Skinner/{&}/g
s/Schafer/{&}/g
s/Dempster/{&}/g
s/Runge/{&}/g
s/Kutta/{&}/g
s/Pollaczek/{&}/g
s/Khinchin/{&}/g
s/Palm/{&}/g
s/Erlang/{&}/g
s/Engset/{&}/g
s/Little's/{&}/g
s/Kosten/{&}/g
s/Gittins/{&}/g
s/Feller/{&}/g
s/Cox/{&}/g
s/Poisson/{&}/g
s/Chapman/{&}/g
s/Kolmogorov/{&}/g
s/Smirnov/{&}/g
s/Weiner/{&}/g
s/Hopf/{&}/g
s/Stirling/{&}/g
# computing
s/Buzen/{&}/g
s/Gordon/{&}/g
s/Newell/{&}/g
s/Lemoine/{&}/g
s/Pierce/{&}/g
s/Harrison/{&}/g
s/Cambridge/{&}/g
s/Ethernet/{&}/g
s/Aloha/{&}/g
# coding theory
s/Hamming/{&}/g
s/Huffman/{&}/g
s/Reed/{&}/g
s/Shannon/{&}/g
s/Solomon/{&}/g
s/Viterbi/{&}/g